<div id="content">
  <div id="top">
	<h3>Lost Items</h3>
	<%= render :partial => '/partials/help_link', :locals => {:path => {:controller => "help", :action => "items", :anchor => "lost"}} %>
  </div>
  <div id="filter">
	<div class="left">
	  <p><%= page_entries_info @page_results, {:entry_name => "Lost Item"} %></p>
	</div>
	<div class="right">
    <%= link_to (@show_resolved ? 'Hide Resolved' : 'Show Resolved'), toggle_resolved_lost_items_path %>
	  <%= link_to "Add a Lost Item", new_lost_item_path %>
	</div>
  </div>
  <table id="list">
    <tr class="header">
   	  <th class="first">Type</th>
	  <th class="second">Identifier</th>
	  <th class="third">From</th>
	  <th class="fourth">To</th>
  	  <th class="fourth">Comment</th>
  	  <th class="last">Resolved</th>
    </tr>
  
    <% for lost_item in @page_results %>
		<tr class="row" onmouseover="this.className ='hover';" onmouseout="this.className = 'row';" 
			onclick="document.location.href = '<%= edit_lost_item_path(lost_item) %>';">
		<% if lost_item.item.nil? %>
			<td>Invalid Item</td>
			<td>No Identifier</td>
			<td>No Location</td>
			<td>No Location</td>
			<td>No Comment</td>
			<td>N/A</td>
		<% else %>
			<td><%= lost_item.item.item_type.item_type %></td>
			
			<td>
				<% if lost_item.item.identifiers.empty? %>
					Missing Identifier
				<% else %>
					<% lost_item.item.identifiers.each do |id| %>
						<%= id.identifier_value %>
					<% end %>
				<% end %>
			</td>
			
			<td><%=h lost_item.item.source ? lost_item.item.source.name : "No Source" %></td>
			<td><%=h lost_item.item.destination ? lost_item.item.destination.name : "No Destination" %></td>
			<td><%=h lost_item.comment %></td>
			<td>
				<% if lost_item.resolved %>
					Yes
				<% else %>
					No
				<% end %>
			</td>
		  </tr>
		<% end %>
    <% end %>
  </table>
  <%= render :partial => 'lost_items_pager' %>
</div>

<br />

